package main

import (
	_ "baseLearning/base1/pkg" //引入某个包，但不直接使用包里的函数，而是调用该包里面的init函数
	"fmt"
)

func mainSelf() {
	type msgType uint16

	var textMes msgType = 1000
	// 混用需要类型转换
	var u1001 uint16 = 1001
	//这个msgType 已经和uint16是属于不同的类型了

	//如果需要将uint16的变量赋值给msgType 的变量，则需要进行类型转换
	var imageMes msgType = msgType(u1001)

	fmt.Printf("textMes=%v, type of is %T\n", textMes, textMes)
	fmt.Printf("imageMes =%v, type of is %T\n", imageMes, imageMes)

	//别名不需要类型转换
	//赋值的时候也不用类型转换
	type msgType1 = uint16
	var textMes1 msgType1 = 1000
	// 混用需要类型转换
	var u10011 uint16 = 1001
	var imageMes1 msgType1 = u10011

	fmt.Printf("textMes=%v, type of is %T\n", textMes1, textMes1)
	fmt.Printf("imageMes =%v, type of is %T\n", imageMes1, imageMes1)

}
